package com.cq.hd.order.controller;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.order.api.HfOrderCallbackApi;
import com.cq.hd.order.service.TbOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HfOrderCallbackController implements HfOrderCallbackApi {

    @Autowired
    private TbOrderService orderService;

    @Override
    public Result<Boolean> preOrderCallback(@RequestBody JSONObject dataObj) {
        return ResultGenerator.success(orderService.preOrderCallback(dataObj));
    }

    @Override
    public Result<Boolean> refundCallback(@RequestBody JSONObject dataObj) {
        return ResultGenerator.success(orderService.refundCallback(dataObj));
    }

    @Override
    public Result<Boolean> jsPayCallback(@RequestBody JSONObject dataObj) {
        return ResultGenerator.success(orderService.jsPayCallback(dataObj));
    }
}
